<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="Bootstrap 4 Flex（弹性）布局, lucky">
    <meta name="description" content="最美的不是下雨天，点击左下角来听听我的歌单吧！">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="baidu-site-verification" content="code-qmQBI3gzvo" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>Bootstrap 4 Flex（弹性）布局 | lucky</title>
    <link rel="icon" type="image/png" href="/luckyforefforts/favicon.png">

    <link rel="stylesheet" type="text/css" href="/luckyforefforts/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/luckyforefforts/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/luckyforefforts/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/luckyforefforts/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/luckyforefforts/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/luckyforefforts/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/luckyforefforts/css/my.css">

    <script src="/luckyforefforts/libs/jquery/jquery.min.js"></script>

<meta name="generator" content="Hexo 5.4.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; }  .github-emoji > span { position: relative; z-index: 10; }  .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; }  .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
<link rel="alternate" href="/luckyforefforts/atom.xml" title="lucky" type="application/atom+xml">
</head>




<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/luckyforefforts/" class="waves-effect waves-light">
                    
                    <img src="/luckyforefforts/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">lucky</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/luckyforefforts/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/luckyforefforts/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/luckyforefforts/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/luckyforefforts/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/luckyforefforts/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/luckyforefforts/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/luckyforefforts/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/luckyforefforts/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">lucky</div>
        <div class="logo-desc">
            
            最美的不是下雨天，点击左下角来听听我的歌单吧！
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/luckyforefforts/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/luckyforefforts/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/luckyforefforts/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/luckyforefforts/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/luckyforefforts/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/luckyforefforts/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/luckyforefforts/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/luwanglin" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>follow me
            </a>
        </li>
        
    </ul>
</div>


        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://github.com/luwanglin" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="follow me" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('/luckyforefforts/medias/featureimages/1.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">Bootstrap 4 Flex（弹性）布局</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/luckyforefforts/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        padding: 35px 0 15px 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        padding-bottom: 30px;
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;

        position: absolute;
        right: 23.5vw;
        display: block;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/luckyforefforts/tags/%E5%B8%83%E5%B1%80/">
                                <span class="chip bg-color">布局</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/luckyforefforts/categories/Bootstrap4-%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" class="post-category">
                                Bootstrap4 学习笔记
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2020-08-16
                </div>
                

                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-check fa-fw"></i>更新日期:&nbsp;&nbsp;
                    2021-07-19
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    6.9k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    38 分
                </div>
                

                
            </div>
        </div>
        <hr class="clearfix">

        
        <!-- 是否加载使用自带的 prismjs. -->
        <link rel="stylesheet" href="/luckyforefforts/libs/prism/prism.css">
        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <h2 id="Bootstrap-4-Flex（弹性）布局"><a href="#Bootstrap-4-Flex（弹性）布局" class="headerlink" title="Bootstrap 4 Flex（弹性）布局"></a>Bootstrap 4 Flex（弹性）布局</h2><p>Bootstrap 4 通过 flex 类来控制页面的布局。</p>
<h3 id="弹性盒子-flexbox"><a href="#弹性盒子-flexbox" class="headerlink" title="弹性盒子(flexbox)"></a>弹性盒子(flexbox)</h3><p>Bootstrap 3 与 Bootstrap 4 最大的区别就是 Bootstrap 4 使用弹性盒子来布局，而不是使用浮动来布局。</p>
<p>弹性盒子是 CSS3 的一种新的布局模式，更适合响应式的设计，如果你还不了解 flex，可以阅读我们的 <a target="_blank" rel="noopener" href="https://www.runoob.com/css3/css3-flexbox.html">CSS3 弹性盒子(Flex Box)</a> 教程</p>
<blockquote>
<p>注意：IE9 及其以下版本不支持弹性盒子，所以如果你需要兼容 IE8-9，请使用 Bootstrap 3。</p>
</blockquote>
<p>以下实例使用 d-flex 类创建一个弹性盒子容器，并设置三个弹性子元素：</p>
<pre class="line-numbers language-none"><code class="language-none">&lt;div class="container-fluid mt-3"&gt;
    &lt;h2&gt;Flex&lt;/h2&gt;
    &lt;p&gt;使用 d-flex 类创建一个弹性盒子容器，并设置三个弹性子元素：&lt;/p&gt;
    &lt;div class="d-flex p-3 bg-secondary text-white"&gt;
        &lt;div class="p-2 bg-info"&gt;Flex item 1&lt;/div&gt;
        &lt;div class="p-2 bg-warning"&gt;Flex item 2&lt;/div&gt;
        &lt;div class="p-2 bg-primary"&gt;Flex item 3&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p><img src="https://gitee.com/LuWangLin/picBed_new/raw/master/img/image-20200821105554291.png" alt="image-20200821105554291"></p>
<p>创建显示在同一行上的弹性盒子容器可以使用 d-inline-flex 类:</p>
<pre class="line-numbers language-html" data-language="html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container mt-3<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">&gt;</span></span>行内 Flex<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>创建显示在同一行上的弹性盒子容器可以使用 d-inline-flex 类:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-inline-flex p-3 bg-secondary text-white<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-info<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-warning<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-primary<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p><img src="https://gitee.com/LuWangLin/picBed_new/raw/master/img/image-20200821105757708.png" alt="image-20200821105757708"></p>
<h3 id="水平方向"><a href="#水平方向" class="headerlink" title="水平方向"></a>水平方向</h3><p><strong>.flex-row</strong> 可以设置弹性子元素水平显示，这是默认的。</p>
<p>使用 <strong>.flex-row-reverse</strong> 类用于设置右对齐显示，即与 <strong>.flex-row</strong> 方向相反。<code>并且翻转了元素的顺序</code></p>
<pre class="line-numbers language-html" data-language="html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container mt-3<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">&gt;</span></span>水平方向<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>使用 .flex-row 类设置弹性子元素水平显示：<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex flex-row bg-secondary mb-3<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-info<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-warning<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-primary<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.flex-row-reverse 设置右对齐方向:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex flex-row-reverse bg-secondary<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-info<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-warning<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-primary<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p><img src="https://gitee.com/LuWangLin/picBed_new/raw/master/img/image-20200821110001688.png" alt="image-20200821110001688"></p>
<h3 id="垂直方向"><a href="#垂直方向" class="headerlink" title="垂直方向"></a>垂直方向</h3><p><strong>.flex-column</strong> 类用于设置弹性子元素垂直方向显示, <strong>.flex-column-reverse</strong> 用于翻转子元素：</p>
<p><img src="https://gitee.com/LuWangLin/picBed_new/raw/master/img/image-20200821110155343.png" alt="image-20200821110155343"></p>
<h3 id="内容排列"><a href="#内容排列" class="headerlink" title="内容排列"></a>内容排列</h3><p><strong>.justify-content-*</strong> 类用于修改弹性子元素的排列方式，***** 号允许的值有：<strong>start (默认), end, center, between 或 around</strong>:</p>
<pre class="line-numbers language-HTML" data-language="HTML"><code class="language-HTML">&lt;div class="container mt-3"&gt;
    &lt;h2&gt;内容排列方式&lt;/h2&gt;
    &lt;p&gt; .justify-content-* 类用于修改弹性子元素的排列方式，* 号允许的值有：start (默认), end, center, between 或 around:&lt;/p&gt;
    &lt;div class="d-flex justify-content-start bg-secondary mb-3"&gt;
        &lt;div class="p-2 bg-info"&gt;Flex item 1&lt;/div&gt;
        &lt;div class="p-2 bg-warning"&gt;Flex item 2&lt;/div&gt;
        &lt;div class="p-2 bg-primary"&gt;Flex item 3&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="d-flex justify-content-end bg-secondary mb-3"&gt;
        &lt;div class="p-2 bg-info"&gt;Flex item 1&lt;/div&gt;
        &lt;div class="p-2 bg-warning"&gt;Flex item 2&lt;/div&gt;
        &lt;div class="p-2 bg-primary"&gt;Flex item 3&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="d-flex justify-content-center bg-secondary mb-3"&gt;
        &lt;div class="p-2 bg-info"&gt;Flex item 1&lt;/div&gt;
        &lt;div class="p-2 bg-warning"&gt;Flex item 2&lt;/div&gt;
        &lt;div class="p-2 bg-primary"&gt;Flex item 3&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="d-flex justify-content-between bg-secondary mb-3"&gt;
        &lt;div class="p-2 bg-info"&gt;Flex item 1&lt;/div&gt;
        &lt;div class="p-2 bg-warning"&gt;Flex item 2&lt;/div&gt;
        &lt;div class="p-2 bg-primary"&gt;Flex item 3&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="d-flex justify-content-around bg-secondary mb-3"&gt;
        &lt;div class="p-2 bg-info"&gt;Flex item 1&lt;/div&gt;
        &lt;div class="p-2 bg-warning"&gt;Flex item 2&lt;/div&gt;
        &lt;div class="p-2 bg-primary"&gt;Flex item 3&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p><img src="https://gitee.com/LuWangLin/picBed_new/raw/master/img/image-20200821110500460.png" alt="image-20200821110500460"></p>
<h3 id="等宽"><a href="#等宽" class="headerlink" title="等宽"></a>等宽</h3><p>.flex-fill 类强制设置各个弹性子元素的宽度是一样的:</p>
<pre class="line-numbers language-HTML" data-language="HTML"><code class="language-HTML">&lt;div class="container mt-3"&gt;
    &lt;h2&gt;等宽&lt;/h2&gt;
    &lt;p&gt;.flex-fill 类强制设置各个弹性子元素的宽度是一样的:&lt;/p&gt;
    &lt;div class="d-flex mb-3"&gt;
        &lt;div class="p-2 flex-fill bg-info"&gt;Flex item 1&lt;/div&gt;
        &lt;div class="p-2 flex-fill bg-warning"&gt;Flex item 2&lt;/div&gt;
        &lt;div class="p-2 flex-fill bg-primary"&gt;Flex item 3&lt;/div&gt;
    &lt;/div&gt;
    &lt;p&gt;不使用 .flex-fill 类实例:&lt;/p&gt;
    &lt;div class="d-flex mb-3 bg-secondary"&gt;
        &lt;div class="p-2 bg-info"&gt;Flex item 1&lt;/div&gt;
        &lt;div class="p-2 bg-warning"&gt;Flex item 2&lt;/div&gt;
        &lt;div class="p-2 bg-primary"&gt;Flex item 3&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p><img src="https://gitee.com/LuWangLin/picBed_new/raw/master/img/image-20200821110619666.png" alt="image-20200821110619666"></p>
<h3 id="扩展"><a href="#扩展" class="headerlink" title="扩展"></a>扩展</h3><p>.flex-grow-1 用于设置子元素使用剩下的空间。以下实例中前面两个子元素只设置了它们所需要的空间，最后一个获取剩余空间。 </p>
<pre class="line-numbers language-html" data-language="html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container mt-3<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">&gt;</span></span>扩展<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.flex-grow-1 用于设置子元素使用剩下的空间：<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex mb-3<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-info<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-warning<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 flex-grow-1 bg-primary<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>不使用 .flex-grow-1 实例:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex mb-3 bg-secondary<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-info<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-warning<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-primary<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p><img src="https://gitee.com/LuWangLin/picBed_new/raw/master/img/image-20200821110925468.png" alt="image-20200821110925468"></p>
<p><code>提示: 使用 .flex-shrink-1 用于设置子元素的收缩规则。</code></p>
<h3 id="排序"><a href="#排序" class="headerlink" title="排序"></a>排序</h3><p><strong>.order</strong> 类可以设置弹性子元素的排序，从 <strong>.order-1</strong> 到 <strong>.order-12</strong>，数字越低权重越高( <strong>.order-1</strong> 排在 <strong>.order-2</strong> 之前) :</p>
<pre class="line-numbers language-html" data-language="html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container mt-3<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">&gt;</span></span>排序<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.order 类可以设置弹性子元素的排序，从 .order-1 到 .order-12，数字越低权重越高:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex mb-3<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 order-3 bg-info<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 order-2 bg-warning<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 order-1 bg-primary<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p><img src="https://gitee.com/LuWangLin/picBed_new/raw/master/img/image-20200821111720158.png" alt="image-20200821111720158"></p>
<h3 id="外边距"><a href="#外边距" class="headerlink" title="外边距"></a>外边距</h3><p><strong>.mr-auto</strong> 类可以设置子元素右外边距为 <strong>auto</strong>，即 <strong>margin-right: auto!important;<strong>，</strong>.ml-auto</strong> 类可以设置子元素左外边距为 <strong>auto</strong>，即 <strong>margin-left: auto!important;</strong>:</p>
<pre class="line-numbers language-html" data-language="html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container mt-3<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">&gt;</span></span>外边距<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.mr-auto 类可以设置子元素右外边距为 auto，.ml-auto 类可以设置子元素左外边距为 auto，<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex mb-3 bg-secondary<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 mr-auto bg-info<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-warning<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-primary<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex mb-3 bg-secondary<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2  bg-info<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 bg-warning<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 ml-auto bg-primary<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p><img src="https://gitee.com/LuWangLin/picBed_new/raw/master/img/image-20200821112039413.png" alt="image-20200821112039413"></p>
<h3 id="包裹"><a href="#包裹" class="headerlink" title="包裹"></a>包裹</h3><p>弹性容器中包裹子元素可以使用以下三个类： .flex-nowrap (默认), .flex-wrap 或 .flex-wrap-reverse。设置 flex 容器是单行或者多行。</p>
<pre class="line-numbers language-html" data-language="html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container mt-3<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">&gt;</span></span>包裹<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>弹性容器中包裹弹性子元素可以使用以下三个类： .flex-nowrap (默认), .flex-wrap 或 .flex-wrap-reverse:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>code</span><span class="token punctuation">&gt;</span></span>.flex-wrap:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>code</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex flex-wrap bg-light<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 4<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 5<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 6<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 7<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 8<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 9<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 10<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 11<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 12<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 13 <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 14<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 15<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 16<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 17<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 18<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 19<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 20<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 21<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 22<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 23<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 24<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 25<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>code</span><span class="token punctuation">&gt;</span></span>.flex-wrap-reverse:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>code</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex flex-wrap-reverse bg-light<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 4<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 5<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 6<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 7<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 8<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 9<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 10<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 11<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 12<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 13 <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 14<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 15<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 16<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 17<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 18<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 19<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 20<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 21<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 22<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 23<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 24<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 25<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>code</span><span class="token punctuation">&gt;</span></span>.flex-nowrap:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>code</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex flex-nowrap bg-light<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 4<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 5<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 6<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 7<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 8<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 9<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 10<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 11<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 12<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 13 <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 14<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 15<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 16<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 17<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 18<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 19<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 20<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 21<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 22<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 23<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 24<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 25<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 26<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 27<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 28<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 29<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 30<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 31<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 32<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 33<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 34<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 35<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p><img src="https://gitee.com/LuWangLin/picBed_new/raw/master/img/image-20200821112428858.png" alt="image-20200821112428858"></p>
<h3 id="内容对齐"><a href="#内容对齐" class="headerlink" title="内容对齐"></a>内容对齐</h3><p>我们可以使用 .align-content-* 来控制在垂直方向上如何去堆叠子元素，包含的值有：.align-content-start (默认), .align-content-end, .align-content-center, .align-content-between, .align-content-around 和 .align-content-stretch。</p>
<p>这些类在只有一行的弹性子元素中是无效的。</p>
<pre class="line-numbers language-HTML" data-language="HTML"><code class="language-HTML">&lt;div class="container mt-3"&gt;
    &lt;h2&gt;内容对齐&lt;/h2&gt;
    &lt;p&gt;我们可以使用 .align-content-* 来控制子元素在垂直方向的对齐方式。&lt;/p&gt;
    &lt;p&gt;&lt;strong&gt;注意:&lt;/strong&gt; 这个实例在小型设备上效果不好。这些类在只有一行的弹性子元素中是无效的。&lt;/p&gt;
    &lt;p&gt;.align-content-start (默认):&lt;/p&gt;
    &lt;div class="d-flex flex-wrap align-content-start bg-light" style="height:300px"&gt;
        &lt;div class="p-2 border"&gt;Flex item 1&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 2&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 3&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 4&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 5&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 6&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 7&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 8&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 9&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 10&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 11&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 12&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 13 &lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 14&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 15&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 16&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 17&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 18&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 19&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 20&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 21&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 22&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 23&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 24&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 25&lt;/div&gt;
    &lt;/div&gt;
    &lt;br&gt;
    &lt;p&gt;.align-content-end:&lt;/p&gt;
    &lt;div class="d-flex flex-wrap align-content-end bg-light" style="height:300px"&gt;
        &lt;div class="p-2 border"&gt;Flex item 1&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 2&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 3&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 4&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 5&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 6&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 7&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 8&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 9&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 10&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 11&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 12&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 13 &lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 14&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 15&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 16&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 17&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 18&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 19&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 20&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 21&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 22&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 23&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 24&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 25&lt;/div&gt;
    &lt;/div&gt;
    &lt;br&gt;
    &lt;p&gt;.align-content-center:&lt;/p&gt;
    &lt;div class="d-flex flex-wrap align-content-center bg-light" style="height:300px"&gt;
        &lt;div class="p-2 border"&gt;Flex item 1&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 2&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 3&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 4&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 5&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 6&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 7&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 8&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 9&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 10&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 11&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 12&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 13 &lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 14&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 15&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 16&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 17&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 18&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 19&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 20&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 21&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 22&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 23&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 24&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 25&lt;/div&gt;
    &lt;/div&gt;
    &lt;br&gt;
    &lt;p&gt;.align-content-around:&lt;/p&gt;
    &lt;div class="d-flex flex-wrap align-content-around bg-light" style="height:300px"&gt;
        &lt;div class="p-2 border"&gt;Flex item 1&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 2&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 3&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 4&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 5&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 6&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 7&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 8&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 9&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 10&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 11&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 12&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 13 &lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 14&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 15&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 16&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 17&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 18&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 19&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 20&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 21&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 22&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 23&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 24&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 25&lt;/div&gt;
    &lt;/div&gt;
    &lt;br&gt;
    &lt;p&gt;.align-content-stretch:&lt;/p&gt;
    &lt;div class="d-flex flex-wrap align-content-stretch bg-light" style="height:300px"&gt;
        &lt;div class="p-2 border"&gt;Flex item 1&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 2&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 3&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 4&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 5&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 6&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 7&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 8&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 9&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 10&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 11&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 12&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 13 &lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 14&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 15&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 16&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 17&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 18&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 19&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 20&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 21&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 22&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 23&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 24&lt;/div&gt;
        &lt;div class="p-2 border"&gt;Flex item 25&lt;/div&gt;
    &lt;/div&gt;
    &lt;br&gt;
&lt;/div&gt;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p><img src="https://gitee.com/LuWangLin/picBed_new/raw/master/img/image-20200821112906150.png" alt="image-20200821112906150"></p>
<h3 id="子元素对齐"><a href="#子元素对齐" class="headerlink" title="子元素对齐"></a>子元素对齐</h3><p>如果要设置单行的子元素对齐可以使用 <strong>.align-items-*</strong> 类来控制，包含的值有：**.align-items-start, .align-items-end, .align-items-center, .align-items-baseline, 和 .align-items-stretch (<code>默认</code>)**。</p>
<pre class="line-numbers language-html" data-language="html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container mt-3<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">&gt;</span></span>子元素对齐<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>如果要设置单行的子元素对齐可以使用 .align-content-* 类来控制。<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.align-items-start:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex align-items-start bg-light<span class="token punctuation">"</span></span> <span class="token style-attr"><span class="token attr-name">style</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token style language-css"><span class="token property">height</span><span class="token punctuation">:</span>150px</span><span class="token punctuation">"</span></span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.align-items-end:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex align-items-end bg-light<span class="token punctuation">"</span></span> <span class="token style-attr"><span class="token attr-name">style</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token style language-css"><span class="token property">height</span><span class="token punctuation">:</span>150px</span><span class="token punctuation">"</span></span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.align-items-center:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex align-items-center bg-light<span class="token punctuation">"</span></span> <span class="token style-attr"><span class="token attr-name">style</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token style language-css"><span class="token property">height</span><span class="token punctuation">:</span>150px</span><span class="token punctuation">"</span></span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.align-items-baseline:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex align-items-baseline bg-light<span class="token punctuation">"</span></span> <span class="token style-attr"><span class="token attr-name">style</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token style language-css"><span class="token property">height</span><span class="token punctuation">:</span>150px</span><span class="token punctuation">"</span></span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.align-items-stretch (默认):<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex align-items-stretch bg-light<span class="token punctuation">"</span></span> <span class="token style-attr"><span class="token attr-name">style</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token style language-css"><span class="token property">height</span><span class="token punctuation">:</span>150px</span><span class="token punctuation">"</span></span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p><img src="https://gitee.com/LuWangLin/picBed_new/raw/master/img/image-20200821113438529.png" alt="image-20200821113438529"></p>
<h3 id="指定子元素对齐"><a href="#指定子元素对齐" class="headerlink" title="指定子元素对齐"></a>指定子元素对齐</h3><p>如果要设置指定子元素对齐对齐可以使用 .align-self-* 类来控制，包含的值有：.align-self-start, .align-self-end, .align-self-center, .align-self-baseline, 和 .align-self-stretch (默认)。</p>
<pre class="line-numbers language-html" data-language="html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container mt-3<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span><span class="token punctuation">&gt;</span></span>Align Self<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>如果要设置指定子元素对齐对齐可以使用 .align-self-* 类来控制。<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.align-self-start:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex bg-light<span class="token punctuation">"</span></span> <span class="token style-attr"><span class="token attr-name">style</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token style language-css"><span class="token property">height</span><span class="token punctuation">:</span>150px</span><span class="token punctuation">"</span></span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border align-self-start<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.align-self-end:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex bg-light<span class="token punctuation">"</span></span> <span class="token style-attr"><span class="token attr-name">style</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token style language-css"><span class="token property">height</span><span class="token punctuation">:</span>150px</span><span class="token punctuation">"</span></span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border align-self-end<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.align-self-center:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex bg-light<span class="token punctuation">"</span></span> <span class="token style-attr"><span class="token attr-name">style</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token style language-css"><span class="token property">height</span><span class="token punctuation">:</span>150px</span><span class="token punctuation">"</span></span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border align-self-center<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.align-self-baseline:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex bg-light<span class="token punctuation">"</span></span> <span class="token style-attr"><span class="token attr-name">style</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token style language-css"><span class="token property">height</span><span class="token punctuation">:</span>150px</span><span class="token punctuation">"</span></span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border align-self-baseline<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>.align-self-stretch (默认):<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>d-flex bg-light<span class="token punctuation">"</span></span> <span class="token style-attr"><span class="token attr-name">style</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token style language-css"><span class="token property">height</span><span class="token punctuation">:</span>150px</span><span class="token punctuation">"</span></span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 1<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border align-self-stretch<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>p-2 border<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>Flex item 3<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>br</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p><img src="https://gitee.com/LuWangLin/picBed_new/raw/master/img/image-20200821113838170.png" alt="image-20200821113838170"></p>
<h3 id="响应式-flex-类"><a href="#响应式-flex-类" class="headerlink" title="响应式 flex 类"></a>响应式 flex 类</h3><p>我们可以根据不同的设备，设置 flex 类，从而实现页面响应式布局，以下表格中的 * 号可以的值有：sm, md, lg 或 xl, 对应的是小型设备、中型设备，大型设备，超大型设备。</p>
<table>
<thead>
<tr>
<th align="left">类</th>
<th align="left">实例</th>
<th align="left">实现</th>
</tr>
</thead>
<tbody><tr>
<td align="left">弹性容器</td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>.d-*-flex</code></td>
<td align="left">根据不同的屏幕设备创建弹性盒子容器</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs4_flex-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.d-*-inline-flex</code></td>
<td align="left">根据不同的屏幕设备创建行内弹性盒子容器</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs4_flex-inline-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left">方向</td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>.flex-*-row</code></td>
<td align="left">根据不同的屏幕设备在水平方向显示弹性子元素</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs4_flex-row-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.flex-*-row-reverse</code></td>
<td align="left">根据不同的屏幕设备在水平方向显示弹性子元素，且右对齐</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs4_flex-row-reverse-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.flex-*-column</code></td>
<td align="left">根据不同的屏幕设备在垂直方向显示弹性子元素</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs4_flex-column-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.flex-*-column-reverse</code></td>
<td align="left">根据不同的屏幕设备在垂直方向显示弹性子元素，且方向相反</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs4_flex-column-reverse-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left">内容对齐</td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>.justify-content-*-start</code></td>
<td align="left">根据不同屏幕设备在开始位置显示弹性子元素 (左对齐)</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-justify-start-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.justify-content-*-end</code></td>
<td align="left">根据不同屏幕设备在尾部显示弹性子元素 (右对齐)</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-justify-end-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.justify-content-*-center</code></td>
<td align="left">根据不同屏幕设备在 flex 容器中居中显示子元素</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-justify-center-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.justify-content-*-between</code></td>
<td align="left">根据不同屏幕设备使用 “between” 显示弹性子元素</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-justify-between-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.justify-content-*-around</code></td>
<td align="left">根据不同屏幕设备使用 “around” 显示弹性子元素</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-justify-around-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left">等宽</td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>.flex-*-fill</code></td>
<td align="left">根据不同的屏幕设备强制等宽</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs4_flex-fill-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left">扩展</td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>.flex-*-grow-0</code></td>
<td align="left">不同的屏幕设备不设置扩展</td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>.flex-*-grow-1</code></td>
<td align="left">不同的屏幕设备设置扩展</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">收缩</td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>.flex-*-shrink-0</code></td>
<td align="left">不同的屏幕设备不设置收缩</td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>.flex-*-shrink-1</code></td>
<td align="left">不同的屏幕设备设置收缩</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">包裹</td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>.flex-*-nowrap</code></td>
<td align="left">不同的屏幕设备不设置包裹元素</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs4_flex-nowrap-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.flex-*-wrap</code></td>
<td align="left">不同的屏幕设备设置包裹元素</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs4_flex-wrap-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.flex-*-wrap-reverse</code></td>
<td align="left">不同的屏幕设备反转包裹元素</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs4_flex-wrap-reverse-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left">内容排列</td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>.align-content-*-start</code></td>
<td align="left">根据不同屏幕设备在起始位置堆叠元素</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-content-start-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.align-content-*-end</code></td>
<td align="left">根据不同屏幕设备在结束位置堆叠元素</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-content-end-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.align-content-*-center</code></td>
<td align="left">根据不同屏幕设备在中间位置堆叠元素</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-content-center-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.align-content-*-around</code></td>
<td align="left">根据不同屏幕设备，使用 “around” 堆叠元素</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-content-around-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.align-content-*-stretch</code></td>
<td align="left">根据不同屏幕设备，通过伸展元素来堆叠</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-content-stretch-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left">元素对齐</td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>.align-items-*-start</code></td>
<td align="left">根据不同屏幕设备，让元素在头部显示在同一行。</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-items-start-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.align-items-*-end</code></td>
<td align="left">根据不同屏幕设备，让元素在尾部显示在同一行。</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-items-end-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.align-items-*-center</code></td>
<td align="left">根据不同屏幕设备，让元素在中间位置显示在同一行。</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-items-center-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.align-items-*-baseline</code></td>
<td align="left">根据不同屏幕设备，让元素在基线上显示在同一行。</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-items-baseline-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.align-items-*-stretch</code></td>
<td align="left">根据不同屏幕设备，让元素延展高度并显示在同一行。</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-items-stretch-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left">单独一个子元素的对齐方式</td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>.align-self-*-start</code></td>
<td align="left">据不同屏幕设备，让单独一个子元素显示在头部。</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-self-start-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.align-self-*-end</code></td>
<td align="left">据不同屏幕设备，让单独一个子元素显示在尾部</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-self-end-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.align-self-*-center</code></td>
<td align="left">据不同屏幕设备，让单独一个子元素显示在居中位置</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-self-center-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.align-self-*-baseline</code></td>
<td align="left">据不同屏幕设备，让单独一个子元素显示在基线位置</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-self-baseline-responsive">尝试一下</a></td>
</tr>
<tr>
<td align="left"><code>.align-self-*-stretch</code></td>
<td align="left">据不同屏幕设备，延展一个单独子元素</td>
<td align="left"><a target="_blank" rel="noopener" href="https://www.runoob.com/try/try.php?filename=trybs_flex-align-self-stretch-responsive">尝试一下</a></td>
</tr>
</tbody></table>

                
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/luckyforefforts/about" rel="external nofollow noreferrer">luwanglin</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://luwanglin.gitee.io/luckyforefforts/2020/08/16/bootstrap-4-flex-dan-xing-bu-ju/">https://luwanglin.gitee.io/luckyforefforts/2020/08/16/bootstrap-4-flex-dan-xing-bu-ju/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="/luckyforefforts/about" target="_blank">luwanglin</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/luckyforefforts/tags/%E5%B8%83%E5%B1%80/">
                                    <span class="chip bg-color">布局</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/luckyforefforts/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/luckyforefforts/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/luckyforefforts/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/luckyforefforts/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>

            
        </div>
    </div>

    

    

    

    

    
        <style>
    .valine-card {
        margin: 1.5rem auto;
    }

    .valine-card .card-content {
        padding: 20px 20px 5px 20px;
    }

    #vcomments textarea {
        box-sizing: border-box;
        background: url("/luckyforefforts/medias/comment_bg.png") 100% 100% no-repeat;
    }

    #vcomments p {
        margin: 2px 2px 10px;
        font-size: 1.05rem;
        line-height: 1.78rem;
    }

    #vcomments blockquote p {
        text-indent: 0.2rem;
    }

    #vcomments a {
        padding: 0 2px;
        color: #4cbf30;
        font-weight: 500;
        text-decoration: none;
    }

    #vcomments img {
        max-width: 100%;
        height: auto;
        cursor: pointer;
    }

    #vcomments ol li {
        list-style-type: decimal;
    }

    #vcomments ol,
    ul {
        display: block;
        padding-left: 2em;
        word-spacing: 0.05rem;
    }

    #vcomments ul li,
    ol li {
        display: list-item;
        line-height: 1.8rem;
        font-size: 1rem;
    }

    #vcomments ul li {
        list-style-type: disc;
    }

    #vcomments ul ul li {
        list-style-type: circle;
    }

    #vcomments table, th, td {
        padding: 12px 13px;
        border: 1px solid #dfe2e5;
    }

    #vcomments table, th, td {
        border: 0;
    }

    table tr:nth-child(2n), thead {
        background-color: #fafafa;
    }

    #vcomments table th {
        background-color: #f2f2f2;
        min-width: 80px;
    }

    #vcomments table td {
        min-width: 80px;
    }

    #vcomments h1 {
        font-size: 1.85rem;
        font-weight: bold;
        line-height: 2.2rem;
    }

    #vcomments h2 {
        font-size: 1.65rem;
        font-weight: bold;
        line-height: 1.9rem;
    }

    #vcomments h3 {
        font-size: 1.45rem;
        font-weight: bold;
        line-height: 1.7rem;
    }

    #vcomments h4 {
        font-size: 1.25rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    #vcomments h5 {
        font-size: 1.1rem;
        font-weight: bold;
        line-height: 1.4rem;
    }

    #vcomments h6 {
        font-size: 1rem;
        line-height: 1.3rem;
    }

    #vcomments p {
        font-size: 1rem;
        line-height: 1.5rem;
    }

    #vcomments hr {
        margin: 12px 0;
        border: 0;
        border-top: 1px solid #ccc;
    }

    #vcomments blockquote {
        margin: 15px 0;
        border-left: 5px solid #42b983;
        padding: 1rem 0.8rem 0.3rem 0.8rem;
        color: #666;
        background-color: rgba(66, 185, 131, .1);
    }

    #vcomments pre {
        font-family: monospace, monospace;
        padding: 1.2em;
        margin: .5em 0;
        background: #272822;
        overflow: auto;
        border-radius: 0.3em;
        tab-size: 4;
    }

    #vcomments code {
        font-family: monospace, monospace;
        padding: 1px 3px;
        font-size: 0.92rem;
        color: #e96900;
        background-color: #f8f8f8;
        border-radius: 2px;
    }

    #vcomments pre code {
        font-family: monospace, monospace;
        padding: 0;
        color: #e8eaf6;
        background-color: #272822;
    }

    #vcomments pre[class*="language-"] {
        padding: 1.2em;
        margin: .5em 0;
    }

    #vcomments code[class*="language-"],
    pre[class*="language-"] {
        color: #e8eaf6;
    }

    #vcomments [type="checkbox"]:not(:checked), [type="checkbox"]:checked {
        position: inherit;
        margin-left: -1.3rem;
        margin-right: 0.4rem;
        margin-top: -1px;
        vertical-align: middle;
        left: unset;
        visibility: visible;
    }

    #vcomments b,
    strong {
        font-weight: bold;
    }

    #vcomments dfn {
        font-style: italic;
    }

    #vcomments small {
        font-size: 85%;
    }

    #vcomments cite {
        font-style: normal;
    }

    #vcomments mark {
        background-color: #fcf8e3;
        padding: .2em;
    }

    #vcomments table, th, td {
        padding: 12px 13px;
        border: 1px solid #dfe2e5;
    }

    table tr:nth-child(2n), thead {
        background-color: #fafafa;
    }

    #vcomments table th {
        background-color: #f2f2f2;
        min-width: 80px;
    }

    #vcomments table td {
        min-width: 80px;
    }

    #vcomments [type="checkbox"]:not(:checked), [type="checkbox"]:checked {
        position: inherit;
        margin-left: -1.3rem;
        margin-right: 0.4rem;
        margin-top: -1px;
        vertical-align: middle;
        left: unset;
        visibility: visible;
    }
</style>

<div class="card valine-card" data-aos="fade-up">
    <div class="comment_headling" style="font-size: 20px; font-weight: 700; position: relative; padding-left: 20px; top: 15px; padding-bottom: 5px;">
        <i class="fas fa-comments fa-fw" aria-hidden="true"></i>
        <span>评论</span>
    </div>
    <div id="vcomments" class="card-content" style="display: grid">
    </div>
</div>

<script src="/luckyforefforts/libs/valine/av-min.js"></script>
<script src="/luckyforefforts/libs/valine/Valine.min.js"></script>
<script>
    new Valine({
        el: '#vcomments',
        appId: 'pxFDYRsLF63WhjaDAudsi47P-gzGzoHsz',
        appKey: 'DelXOmqgYir3NIOlzu3hL5ik',
        notify: 'true' === 'true',
        verify: 'false' === 'true',
        visitor: 'true' === 'true',
        avatar: 'mm',
        pageSize: '10',
        lang: 'zh-cn',
        placeholder: 'just go go'
    });
</script>

<!--酷Q推送-->


    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/luckyforefforts/2020/08/16/bootstrap-4-shi-yong-cheng-xu-yuan-zi-w3schools/">
                    <div class="card-image">
                        
                        
                        <img src="/luckyforefforts/medias/featureimages/8.jpg" class="responsive-img" alt="Bootstrap 4实用程序（源自W3schools）">
                        
                        <span class="card-title">Bootstrap 4实用程序（源自W3schools）</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2020-08-16
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/luckyforefforts/categories/Bootstrap4-%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" class="post-category">
                                    Bootstrap4 学习笔记
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/luckyforefforts/tags/Bootstrap%E5%B8%B8%E7%94%A8%E6%A0%B7%E5%BC%8F%E6%89%8B%E5%86%8C/">
                        <span class="chip bg-color">Bootstrap常用样式手册</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/luckyforefforts/2020/08/16/boostrap-zha-ge-xi-tong-zi-gua-ying-de-bu-ju/">
                    <div class="card-image">
                        
                        
                        <img src="/luckyforefforts/medias/featureimages/22.jpg" class="responsive-img" alt="boostrap栅格系统自适应的布局">
                        
                        <span class="card-title">boostrap栅格系统自适应的布局</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2020-08-16
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/luckyforefforts/categories/%E5%89%8D%E7%AB%AF/" class="post-category">
                                    前端
                                </a>
                            
                            <a href="/luckyforefforts/categories/%E5%89%8D%E7%AB%AF/Bootstrap/" class="post-category">
                                    Bootstrap
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/luckyforefforts/tags/%E6%A0%85%E6%A0%BC%E7%B3%BB%E7%BB%9F/">
                        <span class="chip bg-color">栅格系统</span>
                    </a>
                    
                    <a href="/luckyforefforts/tags/%E6%B7%B7%E5%90%88%E5%B8%83%E5%B1%80/">
                        <span class="chip bg-color">混合布局</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/luckyforefforts/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/luckyforefforts/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/luckyforefforts/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/luckyforefforts/libs/codeBlock/codeShrink.js"></script>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/luckyforefforts/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




    <footer class="page-footer bg-color">
    
        <link rel="stylesheet" href="/luckyforefforts/libs/aplayer/APlayer.min.css">
<style>
    .aplayer .aplayer-lrc p {
        
        display: none;
        
        font-size: 12px;
        font-weight: 700;
        line-height: 16px !important;
    }

    .aplayer .aplayer-lrc p.aplayer-lrc-current {
        
        display: none;
        
        font-size: 15px;
        color: #42b983;
    }

    
    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body {
        left: -66px !important;
    }

    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body:hover {
        left: 0px !important;
    }

    
</style>
<div class="">
    
    <div class="row">
        <meting-js class="col l8 offset-l2 m10 offset-m1 s12"
                   server="netease"
                   type="playlist"
                   id="120456214"
                   fixed='true'
                   autoplay='false'
                   theme='#42b983'
                   loop='all'
                   order='random'
                   preload='auto'
                   volume='0.7'
                   list-folded='true'
        >
        </meting-js>
    </div>
</div>

<script src="/luckyforefforts/libs/aplayer/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>

    
    <div class="container row center-align" style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2019-2021</span>
            
            <a href="/luckyforefforts/about" target="_blank">luwanglin</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                class="white-color">85.7k</span>&nbsp;字
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link ">
    <a href="https://github.com/luwanglin" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:1769862620@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=1769862620" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 1769862620" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>





    <a href="https://www.zhihu.com/people/chen-zao-12-93" class="tooltipped" target="_blank" data-tooltip="关注我的知乎: https://www.zhihu.com/people/chen-zao-12-93" data-position="top" data-delay="50">
        <i class="fab fa-zhihu1">知</i>
    </a>



    <a href="/luckyforefforts/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/luckyforefforts/search.xml', 'searchInput', 'searchResult');
});
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/luckyforefforts/libs/materialize/materialize.min.js"></script>
    <script src="/luckyforefforts/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/luckyforefforts/libs/aos/aos.js"></script>
    <script src="/luckyforefforts/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/luckyforefforts/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/luckyforefforts/js/matery.js"></script>

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/luckyforefforts/libs/others/clicklove.js" async="async"></script>
    
    

    

    

    <!--腾讯兔小巢-->
    
    

    

    

    
    <script src="/luckyforefforts/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
